package com.joysuch.wwyt.attendance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.attendance.bean.ParticipantBean;
import com.joysuch.wwyt.attendance.dto.AttendanceGroupDto;
import com.joysuch.wwyt.attendance.entity.AttendanceGroup;
import com.joysuch.wwyt.attendance.entity.AttendanceShift;
import com.joysuch.wwyt.attendance.vo.AttendanceGroupShiftVo;
import com.joysuch.wwyt.attendance.vo.AttendanceGroupVo;
import com.joysuch.wwyt.core.bean.SimpleListBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zqw
 * @since 2022-03-01
 */
public interface AttendanceGroupService extends IService<AttendanceGroup> {

    /**
     * 保存考情组
     *
     * @param dto
     * @return
     * @throws ApiBusinessException
     */
    AttendanceGroup saveGroup(AttendanceGroupDto dto) throws ApiBusinessException;


    /**
     * 查看考勤组详情
     *
     * @param id
     * @return
     */
    AttendanceGroupVo findById(Long id);


    /**
     * 考勤列表
     *
     * @return
     */
    List<SimpleListBean> getList();

    /**
     * 定时任务-获取所有的固定考勤班次考勤组
     *
     * @param orgCode
     * @param orgCode
     * @param tenentId
     * @return
     */
    List<AttendanceGroup> getGroupByAttendanceFlag(Integer attendanceFlag, String orgCode, Long tenentId);


    /**
     * 删除考勤组
     *
     * @param id 考勤组id
     */
    void deleteById(Long id) throws ApiBusinessException;


    /**
     * 获取各考勤组最近的配置信息
     *
     * @return
     */
    List<AttendanceGroup> getLastGroupList();

    /**
     * 获取考勤组配置的考勤班次信息
     *
     * @param group
     * @return
     */
    List<AttendanceGroupShiftVo> getShiftBeanLisFromGroup(AttendanceGroup group);


    /**
     * 获取考勤组配置的参与对象信息
     *
     * @param group
     * @return
     */
    List<ParticipantBean> getParticipantList(AttendanceGroup group);


    /**
     * 获取考勤组 考勤班次信息
     *
     * @param group
     * @return
     */
    List<AttendanceShift> getGroupShiftList(AttendanceGroup group);
}
